// 构造类
class Animal1{
    constructor(name){
        this.name = name
    }
    run(){
        return `${this.name} is running`
    }
}

const dog = new Animal1('dogtt')
console.log(dog.run(),dog.name)

// 实现继承
class Dog1 extends Animal {
    bark(){
        return `${this.name}is barking`
    }
}

const bo = new Dog1('bo')
console.log(bo.run());
console.log(bo.bark());

// 实现多态，对定义的 run 方法进行改写
class Cat1 extends Animal{
    static categories = ['mammal']
    constructor(name){
        super(name)
        console.log(this.name);
    }
    run(){
        return 'Meow, ' +super.run()
    }
}

const maomao1 = new Cat1('maomao')
console.log(maomao.run());
console.log(Cat1.categories);